'\" te
.\"  Copyright (c) 2006, Sun Microsystems, Inc.,  All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH SCSI_LOG 9F "Jan 16, 2006"
.SH NAME
scsi_log \- display a SCSI-device-related message
.SH SYNOPSIS
.nf
#include <sys/scsi/scsi.h>
 #include <sys/cmn_err.h>



\fBvoid\fR \fBscsi_log\fR(\fBdev_info_t *\fR\fIdip\fR, \fBchar *\fR\fIdrv_name\fR, \fBuint_t\fR \fIlevel\fR,
     \fBconst char *\fR\fIfmt\fR\fB, ...\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH PARAMETERS
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 12n
Pointer to the \fBdev_info\fR structure.
.RE

.sp
.ne 2
.na
\fB\fIdrv_name\fR\fR
.ad
.RS 12n
String naming the device.
.RE

.sp
.ne 2
.na
\fB\fIlevel\fR\fR
.ad
.RS 12n
Error level.
.RE

.sp
.ne 2
.na
\fB\fIfmt\fR\fR
.ad
.RS 12n
Display format.
.RE

.SH DESCRIPTION
The \fBscsi_log()\fR function is a utility function that displays a message via
the \fBcmn_err\fR(9F) routine. The error levels that can be passed in to this
function are \fBCE_PANIC\fR, \fBCE_WARN\fR, \fBCE_NOTE\fR, \fBCE_CONT\fR, and
\fBSCSI_DEBUG\fR. The last level is used to assist in displaying debug messages
to the console only. \fIdrv_name\fR is the short name by which this device is
known; example disk driver names are \fBsd\fR and \fBcmdk\fR. If the
\fIdev_info_t\fR pointer is \fINULL\fR, then the \fIdrv_name\fR will be used
with no unit or long name.
.sp
.LP
If the first character in \fIformat\fR is:
.RS +4
.TP
.ie t \(bu
.el o
An exclamation mark (\fB!\fR), the message goes only to the system buffer.
.RE
.RS +4
.TP
.ie t \(bu
.el o
A caret (\fB^\fR), the message goes only to the console.
.RE
.RS +4
.TP
.ie t \(bu
.el o
A question mark (\fB?\fR) and \fIlevel\fR is \fBCE_CONT\fR, the message is
always sent to the system buffer, but is written to the console only when the
system has been booted in verbose mode. See \fBkernel\fR(8). If neither
condition is met, the \fB?\fR character has no effect and is simply ignored.
.RE
.sp
.LP
All formatting conversions in use by \fBcmn_err()\fR also work with
\fBscsi_log()\fR.
.SH CONTEXT
The \fBscsi_log()\fR function may be called from user, interrupt, or kernel
context.
.SH SEE ALSO
.BR sd (4D),
.BR kernel (8),
.BR cmn_err (9F),
.BR scsi_errmsg (9F)
.sp
.LP
\fIWriting Device Drivers\fR
